/**
 *	\file AKTTTBasicDrawing.h
 *  
 *  \section desc_sec Description
 *  Description
 *  
 *  \if copyright
 *  	Copyright 2008 Ben Chen. All rights reserved.
 *  \endif
 *  
 *  \section hist_sec Change History:
 *  	-	1/19/08		BC		Created this file
 *  
 *  <hr>
 *  \addtogroup AnimalKingdom
 *  @{
 */

#import "AKImageProvider.h"
#import "AKAnimationProvider.h"
#import "AKGeometryProvider.h"
#import "AKBasicInfoProvider.h"

#import "AKBasicDrawing.h"
#import "AKInteractiveDrawing.h"

#import <QuartzCore/QuartzCore.h>

typedef int AKDrawingTransactionState;

@protocol AKImageProvider, AKImagAKGeometryProvider, AKBasicInfoProvider;

@interface AKDrawing : NSObject <AKBasicDrawing, AKInteractiveDrawing> {
	id <AKImageProvider>		imageProvider;
	id <AKAnimationProvider>	animationProvider;
	id <AKGeometryProvider>		geometryProvider;
	id <AKBasicInfoProvider>	basicInfoProvider;
	AKView						*drawingView;
	id							delegate;
	
	// Drawing
	NSMutableDictionary			*pieces;		///< For storing piece info. Keys are obtained by AKStringFromPiece, values are PieceInfos wrapped in NSValue.
	CALayer		*containerLayer;
	CALayer		*background;
	CALayer		*reflectionLayer;
	CALayer		*piecesLayer;
	
	CALayer		*draggedPiece;
	CALayer		*draggedReflection;
	NSValue		*draggedValue;
	
	// Activation
	NSNumber *zeroNumber, *oneNumber;
	CABasicAnimation	*activationAnimation;
	CABasicAnimation	*deactivationAnimation;
	NSValue				*activatedPiece;
	
	// Removing
	NSMutableSet		*removingInfoSet;
	
	// Transaction
	AKDrawingTransactionState transactionState;
	NSString			*transactionName;
	NSMutableSet		*animationsInTransaction;
	
#ifdef AKIPHONE
	CGSize activatedPieceOriSize;
	CGSize activatedPieceOriRefSize;
#endif
}

- (id)initWithImageProvider:(id <AKImageProvider>)anImageProvider 
		  animationProvider:(id <AKAnimationProvider>)anAnimationProvider
		   geometryProvider:(id <AKGeometryProvider>)aGeometryProvider
		  basicInfoProvider:(id <AKBasicInfoProvider>)aBasicInfoProvider
				   drawView:(AKView*)aDrawView;

@end

/** @} */
